﻿using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Simple2.Common;

namespace Simple2.ViewModel;

public partial class MainViewModel: ObservableObject
{
    [ObservableProperty]
    public ObservableCollection<MenuModel> _menuModels;

    [ObservableProperty]
    public MenuModel _selectedMenuModel=new();
    
    
    public MainViewModel()
    {
        MenuModels = new ObservableCollection<MenuModel>();
        MenuModels.Add(new MenuModel() { IconFont = "\xe608", Title = "Live scores", });
        MenuModels.Add(new MenuModel() { IconFont = "\xe620", Title = "Series",  });
        MenuModels.Add(new MenuModel() { IconFont = "\xe622", Title = "Teams",  });
        MenuModels.Add(new MenuModel() { IconFont = "\xe603", Title = "Features",  });
        MenuModels.Add(new MenuModel() { IconFont = "\xe51c", Title = "Videos", });
        MenuModels.Add(new MenuModel() { IconFont = "\xe790", Title = "Stats", });
        MenuModels.Add(new MenuModel() { IconFont = "\xe672", Title = "World cup 2019", });
    }

    [RelayCommand]
    public void Select(MenuModel menuModel)
    {
        Console.WriteLine(menuModel.Title);        
    }
}